package com.video.web.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api(tags = "首页模块")
@RestController
public class DruidController {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @ApiOperation(value = "查询所有用户数据",
            protocols = "http",
            httpMethod="GET",
            consumes="application/json",
            response= List.class,
            notes = "code:200 表示成功")
    @GetMapping(value="/index")
    public List<Map<String,Object>> index(){
        List<Map<String, Object>> list = jdbcTemplate
                .queryForList("select * from smbms_user");
        return list;
    }
}
